package net.lahuobao.mall.entity.admin;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.*;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

/**   
 * @Title: Entity
 * @Description: O2O订单
 * @author zhangdaihao
 * @date 2016-12-28 10:16:50
 * @version V1.0   
 *
 */
@Entity
@Table(name = "mall_order_o2o", schema = "lahuobao")
@DynamicUpdate(true)
@DynamicInsert(true)
@SuppressWarnings("serial")
public class MallOrderO2oEntity implements java.io.Serializable {
	/**id*/
	private java.lang.Integer id;
	/**orderid*/
	private java.lang.Integer orderid;
	/**mobilephone*/
	private java.lang.String mobilephone;
	/**consumecode*/
	private java.lang.String consumecode;
	/**consumetime*/
	private java.util.Date consumetime;
	/**consumestoreid*/
	private java.lang.Integer consumestoreid;
	/**shopuserid*/
	private java.lang.Integer shopuserid;
	/**orderstatus*/
	private java.lang.Integer orderstatus;
	/**startdatetime*/
	private java.util.Date startdatetime;
	/**enddatetime*/
	private java.util.Date enddatetime;

	private String orderStatusName;
	/**
	 *方法: 取得java.lang.Integer
	 *@return: java.lang.Integer  id
	 */
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name ="ID",nullable=false,precision=10,scale=0)
	public java.lang.Integer getId(){
		return this.id;
	}

	/**
	 *方法: 设置java.lang.Integer
	 *@param: java.lang.Integer  id
	 */
	public void setId(java.lang.Integer id){
		this.id = id;
	}
	/**
	 *方法: 取得java.lang.Integer
	 *@return: java.lang.Integer  orderid
	 */
	@Column(name ="ORDERID",nullable=false,precision=10,scale=0)
	public java.lang.Integer getOrderid(){
		return this.orderid;
	}

	/**
	 *方法: 设置java.lang.Integer
	 *@param: java.lang.Integer  orderid
	 */
	public void setOrderid(java.lang.Integer orderid){
		this.orderid = orderid;
	}
	/**
	 *方法: 取得java.lang.String
	 *@return: java.lang.String  mobilephone
	 */
	@Column(name ="MOBILEPHONE",nullable=true,length=11)
	public java.lang.String getMobilephone(){
		return this.mobilephone;
	}

	/**
	 *方法: 设置java.lang.String
	 *@param: java.lang.String  mobilephone
	 */
	public void setMobilephone(java.lang.String mobilephone){
		this.mobilephone = mobilephone;
	}
	/**
	 *方法: 取得java.lang.String
	 *@return: java.lang.String  consumecode
	 */
	@Column(name ="CONSUMECODE",nullable=false,length=20)
	public java.lang.String getConsumecode(){
		return this.consumecode;
	}

	/**
	 *方法: 设置java.lang.String
	 *@param: java.lang.String  consumecode
	 */
	public void setConsumecode(java.lang.String consumecode){
		this.consumecode = consumecode;
	}
	/**
	 *方法: 取得java.util.Date
	 *@return: java.util.Date  consumetime
	 */
	@Column(name ="CONSUMETIME",nullable=true)
	public java.util.Date getConsumetime(){
		return this.consumetime;
	}

	/**
	 *方法: 设置java.util.Date
	 *@param: java.util.Date  consumetime
	 */
	public void setConsumetime(java.util.Date consumetime){
		this.consumetime = consumetime;
	}
	/**
	 *方法: 取得java.lang.Integer
	 *@return: java.lang.Integer  consumestoreid
	 */
	@Column(name ="CONSUMESTOREID",nullable=true,precision=10,scale=0)
	public java.lang.Integer getConsumestoreid(){
		return this.consumestoreid;
	}

	/**
	 *方法: 设置java.lang.Integer
	 *@param: java.lang.Integer  consumestoreid
	 */
	public void setConsumestoreid(java.lang.Integer consumestoreid){
		this.consumestoreid = consumestoreid;
	}
	/**
	 *方法: 取得java.lang.Integer
	 *@return: java.lang.Integer  shopuserid
	 */
	@Column(name ="SHOPUSERID",nullable=true,precision=10,scale=0)
	public java.lang.Integer getShopuserid(){
		return this.shopuserid;
	}

	/**
	 *方法: 设置java.lang.Integer
	 *@param: java.lang.Integer  shopuserid
	 */
	public void setShopuserid(java.lang.Integer shopuserid){
		this.shopuserid = shopuserid;
	}
	/**
	 *方法: 取得java.lang.Integer
	 *@return: java.lang.Integer  orderstatus
	 */
	@Column(name ="ORDERSTATUS",nullable=false,precision=10,scale=0)
	public java.lang.Integer getOrderstatus(){
		return this.orderstatus;
	}

	/**
	 *方法: 设置java.lang.Integer
	 *@param: java.lang.Integer  orderstatus
	 */
	public void setOrderstatus(java.lang.Integer orderstatus){
		this.orderstatus = orderstatus;
	}
	/**
	 *方法: 取得java.util.Date
	 *@return: java.util.Date  startdatetime
	 */
	@Column(name ="STARTDATETIME",nullable=true)
	public java.util.Date getStartdatetime(){
		return this.startdatetime;
	}

	/**
	 *方法: 设置java.util.Date
	 *@param: java.util.Date  startdatetime
	 */
	public void setStartdatetime(java.util.Date startdatetime){
		this.startdatetime = startdatetime;
	}
	/**
	 *方法: 取得java.util.Date
	 *@return: java.util.Date  enddatetime
	 */
	@Column(name ="ENDDATETIME",nullable=true)
	public java.util.Date getEnddatetime(){
		return this.enddatetime;
	}

	/**
	 *方法: 设置java.util.Date
	 *@param: java.util.Date  enddatetime
	 */
	public void setEnddatetime(java.util.Date enddatetime){
		this.enddatetime = enddatetime;
	}

	@Transient
	public String getOrderStatusName() {
		String str = "";
		switch (this.orderstatus){
			case 1:
				str = "等待付款";
				break;
			case 2:
				str = "已支付";
				break;
			case 3:
				str = "已发货";
				break;
			case 4:
				str = "退款中";
				break;
			case 5:
				str = "交易完成";
				break;
			case 6:
				str = "已结算";
				break;
			case 99:
				str = "交易关闭";
				break;
			case 98:
				str = "支付未完成";
				break;
		}
		return str;
	}

	public void setOrderStatusName(String orderStatusName) {
		this.orderStatusName = orderStatusName;
	}
}
